﻿@{
     string path ="~/pdf";
     string ccappnos = Request["ccappnos"];
     var ccList= CashCardManager.ExtractSelected(ccappnos);
     string fileName =null;
     foreach(var c in ccList){
           fileName = UtilityManager.FillCashCardTemplate(Server.MapPath(path),c);
     }
    
    byte[] byteArray = UtilityManager.FileToByteArray(Server.MapPath(path)+"/"+fileName);
    //clear all content output from the buffer stream
    
    Response.Clear();
    //add HTTP Header to the output stream and speficy default name for the browser download dialog
    
    Response.AddHeader("Content-Disposition","attachment; filename="+fileName);
    //add header for file size
    Response.AddHeader("Content-Length",byteArray.Length.ToString());
    //set HTTP Mime Type
    Response.ContentType="application/vnd.ms-excel";
    //Write data to the client
    Response.BinaryWrite(byteArray);
    Response.Flush();
    Response.End();
}